package com.hlt.meta.service.impl;

import com.hlt.meta.entity.User;
import com.hlt.meta.mapper.UserMapper;
import com.hlt.meta.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.Console;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    public User getUserById(int userId) {

        return userMapper.selectByPrimaryKey(userId);
    }
    public boolean addUser(User record){
        boolean result = false;
        try {
            userMapper.insertSelective(record);
            result = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

}